package main

import "fmt"

func ShowFoods(foods [3]string) {
	// 入参时会创建副本, 不会影响原数组

	foods[0] = "糖醋里脊"
	fmt.Println(foods)
}

// ShowFoodsPoint 指针传递
func ShowFoodsPoint(foods *[3]string) {
	// 入参时会创建副本, 不会影响原数组

	foods[0] = "糖醋里脊"
	fmt.Println(foods)
}
func main() {

	todayFoods := [3]string{"卤肉饭", "西红柿炒鸡蛋", "羊汤"}
	ShowFoods(todayFoods)
	fmt.Println(todayFoods)

	ShowFoodsPoint(&todayFoods)
	fmt.Println(todayFoods)
}
